/*
 * @Author: mayijun
 * @Date: 2022-05-14 11:12:52
 * @LastEditors: mayijun
 * @LastEditTime: 2022-06-16 17:49:50
 */

// 指标应用
import { RouteRecordRaw } from 'vue-router';
import * as RouteNames from '../consts';
const routes: RouteRecordRaw[] = [
  {
    path: '/application',
    // component: () => import('@/layout/index.vue'),
    component: () => import('@/layout/base-layout.vue'),
    redirect: '/application/fetch',
    meta: { title: '指标应用' },
    children: [
      {
        path: 'fetch',
        name: RouteNames.ROUTE_APPLICATIONFETCH,
        component: () => import('@/views/indexApplication/fetchData/index'),
        meta: { title: '指标取数' }
      },
      {
        path: 'fetch/self',
        name: RouteNames.ROUTE_APPLICATIONFETCHSELF,
        component: () => import('@/views/indexApplication/config/index'),
        meta: { title: 'DIY取数' }
      },
      {
        path: 'fetch/scene',
        name: RouteNames.ROUTE_APPLICATIONFETCHSCENE,
        component: () => import('@/views/indexApplication/config/index'),
        meta: { title: '场景取数' }
      },
      {
        path: 'task',
        name: RouteNames.ROUTE_APPLICATIONFETCHTASK,
        component: () => import('@/views/indexApplication/task/index'),
        meta: { title: '任务管理' }
      },
      {
        path: 'public-dashboard',
        name: RouteNames.ROUTER_PUBLIC_DASHBOARD,
        component: () =>
          import('@/views/indexApplication/publicDashboard/index.vue'),
        meta: { title: '公共看板' }
      },
      {
        path: 'my-dashboard',
        name: RouteNames.ROUTER_MY_DASHBOARD,
        component: () =>
          import('@/views/indexApplication/myDashboard/index.vue'),
        meta: { title: '指标看板' }
      },
      {
        path: 'index-tree',
        name: RouteNames.ROUTER_INDEXTREE,
        component: () => import('@/views/indexApplication/indexTree/index.vue'),
        meta: { title: '指标树' }
      }
    ]
  },
  {
    path: '/application/index-tree-edit',
    name: RouteNames.ROUTER_INDEXTREE_INFO,
    component: () =>
      import('@/views/indexApplication/indexTree/indexTreeGraph/index.vue'),
    meta: { title: '指标树创建' }
  },
  {
    path: '/application/metrics-tree-detail',
    name: RouteNames.ROUTER_METRICS_TREE_DETAIL,
    component: () =>
      import('@/views/indexApplication/indexTree/indexDetail/index.vue'),
    meta: { title: '指标数详情' }
  },
  {
    path: '/application/metrics-dashboard-detail/:id/:type?',
    name: RouteNames.ROUTER_METRICS_DASHBOARD_DETAIL,
    component: () => import('@/views/indexApplication/myDashboard/detail.vue'),
    meta: { title: '指标看板详情' }
  },
  {
    path: '/application/metrics-dashboard-edit/:id?',
    name: RouteNames.ROUTER_METRICS_DASHBOARD_EDIT,
    component: () => import('@/views/indexApplication/myDashboard/edit.vue'),
    meta: { title: '指标看板' }
  }
];

export default routes;
